


public class FormalParam {
	String id;
	Type type;

	public FormalParam(String id, Type type) {
		super();
		this.id = id;
		this.type = type;
	}

	public void check() throws SemanticException {
		SymbolTable table = SymbolTable.getInstance();
		if (table.contains(id))
			throw new SemanticException("ID exists " + id);
		table.add(new Entry(id, Entry.VARIABLE, type.type));
	}

	public String toString() {
		return "Formal Param " + id + "\n";
	}
}
